package com.wxl.micro.service.order.intercptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.UUID;

/***
 * 对feignclient做拦截 可以添加参数 修改参数 等
 */
public class FeignInterceptor implements RequestInterceptor {
    Logger logger= LoggerFactory.getLogger(this.getClass());
    @Override
    public void apply(RequestTemplate requestTemplate) {
        // Todo
        requestTemplate.header("tid", UUID.randomUUID().toString());
//        requestTemplate.query("id","111");
//        requestTemplate.uri("/9");

        logger.info("feign拦截器！");
    }
}
